Previous Thread
Next Thread
Print Thread
Rate Thread
#239492 03/11/2003 2:34 AM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I have been pondering making a Threads "Stats" add on.

In it, I'd hoped to gather and DB referer URLs... as well as tracking page counts, and maybe even page views by user in the last x days.

Nearest I could figure.... and this is my concern, would be adding one query to every page view in threads. Similar to the who's online function.

My *theory* was this:
On each page view, the ubbt.inc.php file would record:
- referer info
- user agent info
- user number
- time stamp

Then to display some stats, you could do a couple of things:
- you could grab all the referers in a certain date period, with a select distinct statment (that aren't from your own site) and sort them to show top referers.
- You could do the same with user agent info.
- You could count the rows in a given date period, and thus know page views.
- You could count the rows by usernumber, and thus know that User X viewed y number of pages this month..... while user A only viewed Z number of pages this month.

Sounds pretty cool... in theory.


My questions/concerns for you guys to voice feedback...

- This would add 1 query per page, similar to the who's online function. Might not be a big deal.... but I'd like feedback on that.
- This would essentially add one row in a database table for every page view. On some sites that would make the table huge in a hurry. Will this slow things down, or would it be OK because you are just Inserting to the table on each view, and not searching into it.
To avoid the table getting too large, it could potentially dump all rows over (60,90,120?) days old automatically. Thus only allowing your stats to go back so far.

Any ideas/feedback on this.
Does it seem doable.
Maybe there is a better/smarter way to structure the table... I'm just thinking off the cuff.

I think I could pull it off, but my concern is database load/speed concerns.


Sponsored Links
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Take this with a grain of salt cause you all know I'm a newby to PHP.

I think most of what you want to record is either available via the built in functions / variables in PHP, or already available from the output of other DB querries, so why would this mod add another querry per page view?

If you are concerned about the table becoming too large on boards with heavy traffic then adding a limit to the amount of data stored is an excellent idea. You could even set it up to record the data to a completely different database.

Joined: Feb 2002
Posts: 295
Member
Member
Offline
Joined: Feb 2002
Posts: 295
Hi,

I may be way of base here, but isn't all this stored in the server's logfiles?

Sanuk!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Some of it is... like the referer and such. But some people don't have access to that... or you need something like Urchin ($$) etc... to easily view it.

Nothing on your server I believe will tell you how many pages a specific user viewed last month.

I can know page views.... but on my site we have age and such in profiles..... it would help for advertising to know that this age group had x number of page views etc...

I have Urchin for stats... but it doesn't relate to my threads users at all. Just overall activity.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Shock Hosting
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,153
Joined: July 2001
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,824
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 464
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 13
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)